<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class Category extends Model
{
    public function getUrlAttr($value)
    {
        if($value) return explode(',',$value);
    }

    public function product()
    {
        return $this->hasMany(Product::class,'category_id','id');
    }
}
